package com.ikaros.entity;

import com.ikaros.enums.OrderStatusEnums;
import com.ikaros.enums.PayStatusEnums;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Ikaros on 2017/9/18.
 */
@Entity
@Data
@DynamicUpdate/*自动更新时间*/
@Table(name = "order_master")
public class OrderMaster {
    @Id
    /** 订单id. */
    private String orderId;

    /** 买家名字. */
    private String buyerName;

    /** 买家电话. */
    private String buyerPhone;

    /** 买家地址. */
    private String buyerAddress;

    /** 买家微信openid. */
    private String buyerOpenid;

    /** 订单总金额. */
    private BigDecimal orderAmount;

    /** 订单状态：默认新订单. */
    private Integer orderStatus= OrderStatusEnums.NEW.getCode();

    /** 支付状态：默认未支付. */
    private Integer payStatus= PayStatusEnums.WAIT.getCode();

    /** 创建时间. */
    private Timestamp createTime;

    /** 更新时间. */
    private Timestamp updateTime;

    /*@Transient*//*jpa查询的时候会忽略该列*//*
    private List<OrderDetail> orderDetailList;*/
}
